﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Verse;

namespace Miao.Stand
{
    public static class Extensions
    {
        public static bool IsStandMaster(this Pawn pawn)
        {

            foreach(StandMasterHediff standHediff in pawn.health.hediffSet.GetHediffs<StandMasterHediff>())
            {
                return true;
            }
            return false;
        }

        public static bool IsStand(this Pawn pawn)
        {
            return pawn is StandPawn;
        }

        public static StandMasterHediff GetStandHediff(this Pawn pawn)
        {
            for (int i = 0; i < pawn.health.hediffSet.hediffs.Count; i++)
            {
                if (pawn.health.hediffSet.hediffs[i] is StandMasterHediff)//用了一个很搞的方式，来让Hediff实际上是HediffDef来互通。
                {
                    return pawn.health.hediffSet.hediffs[i] as StandMasterHediff;
                }
            }
            return null;
        }
    }
}
